<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:j4j="http://javascript4jsf.dev.java.net/" 
      xmlns:a="http://www.cs.ucdavis.edu/jsf" 
      xmlns:c="http://java.sun.com/jstl/core">
	<ui:composition template="/WEB-INF/layout/taxonomyLayout.xhtml">
		
		<ui:define name="facets">
			<h:panelGroup>
				<h3>
					Node matching:
				</h3>
				<div class="left_box">
					<h2>
						<h:outputText value="#{nodeProfile.selectedCategory.key}"/>
					</h2>
				</div>
				
				<a:displayFacet facetName="Keywords: " 
					facetItems="#{nodeProfile.profile.sortedKeywords}"
					facetCounts="#{nodeProfile.profile.keywordsCounts}"
					displayField="keyword"
					limitResults="true"
					limit="10"
					/>
					
				<a:displayFacet facetName="Authors: " 
					facetItems="#{nodeProfile.profile.sortedCoAuthors}"
					facetCounts="#{nodeProfile.profile.coAuthorsCounts}"
					displayField="content"
					separator="break"
					limitResults="true"
					limit="10"
					>
					<ui:define name="display">
					<h:commandLink action="#{searchController.buildResearcherProfile}"
									value="#{item[displayField]}"
									>
									<f:setPropertyActionListener 
										target="#{searchController.researcherName}"
	        							value="#{item[displayField]}"/>
	       			</h:commandLink>
	        		</ui:define>
					</a:displayFacet>
				
				<a:displayFacet facetName="Taxonomy Nodes: " 
					facetItems="#{nodeProfile.profile.sortedLeafCategories}"
					facetCounts="#{nodeProfile.profile.leafCategoriesCounts}"
					displayField="label"
					separator="break"
					limitResults="true"
					limit="5"
					>
					<ui:define name="preDisplay">
						<img src="images/arrow.gif" alt=">" />
						<span class="title" style="font-weight: bold">#{item.parentDescription}</span>
						<br />
					</ui:define>
					
					<ui:define name="display">
						<h:commandLink action="#{nodeProfile.buildProfile}"
										value="#{item[displayField]}"
										>
										<f:setPropertyActionListener 
											target="#{nodeProfile.nodeKey}"
		        							value="#{item.key}"/>
		       			</h:commandLink>
	        		</ui:define>
				</a:displayFacet>
			</h:panelGroup>
		</ui:define>
				
		<ui:define name="results">
			<h:panelGroup>
				<a:displaySearchResults 
					resultsTitle="Publications: (#{nodeProfile.publicationsCount})" 
					searchResults="#{nodeProfile.profile.publications}"
					exportBean="#{nodeProfile}"
					showExportLink="true"
					>
					<ui:define name="resultOutput">
						<c:choose>
							<c:when test="#{not empty result.ee}">
								<h:outputLink value="#{result.ee}" target="_blank"><b>#{result.title}</b></h:outputLink></c:when>
							<c:otherwise><b>#{result.title}</b></c:otherwise>
						</c:choose><br />
						<c:forEach var="author" items="#{result.author}" varStatus="vs">
							#{author.content}<c:if test="#{not vs.last}">, </c:if> 
						</c:forEach><br />
						#{result.citationString}<br/>
					</ui:define>
				</a:displaySearchResults>
			</h:panelGroup>
		</ui:define>
		
	</ui:composition>
C</html>